package entity

import (
	"time"
)

// 字典
type SysDict struct {
	ID         uint      `gorm:"primary_key" json:"id"`
	Name       string    `json:"name"`
	Code       string    `json:"code"`
	Status     uint8     `json:"status"`
	Remark     string    `json:"remark"`
	CreateTime time.Time `json:"createTime" gorm:"column:create_time;type:datetime;autoCreateTime"`
	UpdateTime time.Time `json:"update_time" gorm:"column:update_time;type:datetime;autoCreateTime"`
	IsDeleted  uint8     `json:"isDeleted" gorm:"is_deleted"`
}

func (SysDict) TableName() string {
	return "sys_dict"
}

type SysDictPageQuery struct {
	PageQuery PageQuery
	Keywords  *string `form:"keywords"`
}

type DictPageVO struct {
	ID        uint          `gorm:"primary_key" json:"id"`
	Name      string        `json:"name" form:"name"`
	Code      string        `json:"code" form:"code"`
	Status    uint8         `json:"status" form:"status"`
	DictItems []SysDictItem `json:"dictItems" form:"dictItems"`
}

type DictForm struct {
	ID        uint       `gorm:"primary_key" json:"id"`
	Name      string     `json:"name" form:"name"`
	Code      string     `json:"code" form:"code"`
	Status    uint8      `json:"status" form:"status"`
	DictItems []DictItem `json:"dictItems" form:"dictItems"`
}
